Notes
Outline
Let’s make a Model Train Set
Jon Wolfers
26th International Rexx Language Symposium
April 2015 - Vienna
Why?
London has the oldest underground railway
New practise – Holding to regulate service
Needed modelling – for optimum happiness
Symposium was a good excuse for some fun
Meant to be a weekend project, but…
Train icon by http://www.vectorgraphit.com/
   Elements of the model
Line
Sector
Station
Train
Passenger .
Line Class
Attributes
Name
Colour
Demand
Tick
(Statistics) …  .
Line Class
Attributes (continued)
Collections
Sectors (an array)
Stations (a directory by name & array by SectorId)
Trains (a directory)   .
Sector Class
Attributes
Id
Line
Station
UpTrain
DnTrain
BiDirectional?
isTerminus?   .
Station Class
Attributes
Name
Sector
Line
Capacity
Closing?
Demand, MinPax, MaxPax…   .
Station Class
Attributes (Continued)
Collections
upPax (a Queue)
dnPax (a Queue)
exitingPax (a Queue)
WaitingPax (a Set)   .
Train Class
Attributes
Name
Capacity
Up?
Disabled
OutOfService?
Sector
Line…   .
Train Class
Attributes (continued)
Collection
Passengers (a relation by destination)   .
Passenger Class
Attributes
Up?
Passenger Experience
Origin
Destination
StartTick
EndTick   .
Methods
Line
AddStation
AddTrain
ToggleBiDirectional
Run
Reset
Station
Run
Sector
AddTrain
Run
NextUp, NextDn
Train
Run
Move
Reverse
Passenger
Debrief   .
How to use it
A bit better
How the image is created
Open Source package ImageMagick
http://www.imagemagick.org/
Visualiser’s show_line method:
Interrogates line, walking sectors
Writes a command file
Creates picture
Overlays trains images on it
Saves composed image as .png file
Better still
TrainLineGUI
An ooDialog class (provided by framework)
Creates own visualiser instance
Allows modification of track, train or station by clicking on image
Allows pausable series of ‘run’s
Refreshes the image shown after each run .
Dedicated to Mark Miesfeld